/*
 * @Description:: 请补充填写
 * @Version: 请配置版本号
 * @Author: 小白
 * @Date: 2020-06-10 11:39:15
 * @LastEditors: smallWhite
 * @LastEditTime: 2024-03-14 17:33:57
 * @FilePath: /huizhou-official-website/src/store.js
 */
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    openNav:[],
    navList:[],
    index:'/'
  },
  mutations: {
    setOpenNav (state, nav) { state.openNav = nav },
    setNavList (state,list) {state.navList = list},
    setPathIndex (state,index) {state.index = index}

  },
  actions: {
    //
  },
  getters:{
    navList: state => state.navList
  },
  plugins: [createPersistedState({
    // storage: window.sessionStorage
    storage: window.localStorage
  })],
})
